package org.wkg.lesson01;

public class Demo04 {

    public static void main(String[] args) {
        MyRunnable02 myRunnable02 = new MyRunnable02();
        MyRunnable03 myRunnable03 = new MyRunnable03();

        Thread thread1 = new Thread(myRunnable02);
        Thread thread2 = new Thread(myRunnable02);
        Thread thread3 = new Thread(myRunnable03);
        thread1.start();
        thread2.start();
        thread3.start();

    }



}


class MyRunnable02 implements Runnable{

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("生产皮鞋，金币+20....");

        }
    }
    }



class MyRunnable03 implements Runnable{

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("生产皮包，金币+10....");

        }
    }
}